﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CustomerAdd.ascx.cs" Inherits="PayrollHR.Administration.Modules.CustomerAdd" %>
<%@ Register Src="CaseProfileView.ascx" TagName="CaseProfileView" TagPrefix="uc2" %>
<%@ Register Src="CustomerInfo.ascx" TagName="CustomerInfo" TagPrefix="uc3" %>
<%@ Register Src="ToolTipLabelControl.ascx" TagName="ToolTipLabelControl" TagPrefix="uc1" %>
<%@ Register src="Relationship.ascx" tagname="Relationship" tagprefix="uc4" %>
<asp:UpdatePanel ID="upForumSubscriptions" runat="server">
    <ContentTemplate>
        <script type="text/javascript">
            function show(sender, e) {
                var txt = document.getElementById('<%=ctrlCustomerInfo.FindControl("txtCustName").FindControl("txtValue").ClientID %>');
                if (txt.value == "") {
                    $find('<%=CustomerTabs.ClientID%>').set_activeTabIndex(0);
                }
            }
        </script>
        <div class="section-header">
            <div class="title">
                <img src="Common/ico-catalog.png" alt='<%=GetLocaleResourceString("Admin.CustomerAdd.AddCustomers")%>' />
                <%=GetLocaleResourceString("Admin.CustomerAdd.AddCustomers")%>
                <asp:Label runat="server" ID="lblTitle" />
                <a href="Customers.aspx" title='<%=GetLocaleResourceString("Admin.CustomerAdd.AddCustomers")%>'>
                    <%=GetLocaleResourceString("Admin.CustomerAdd.BackToCustomerList")%>
                </a>
            </div>
            <div class="options">
                <asp:HyperLink ID="hlexport" runat="server" Target="_blank" ForeColor="#6600CC" Visible="False">[hlexport]</asp:HyperLink>
                <asp:Button ID="btnPrintCustInfo" runat="server" CssClass="adminButtonBlue" Text="Print" ToolTip="In thông tin khách hàng" OnClick="btnPrintCustInfo_Click" />
                <asp:Button ID="SaveButton" runat="server" Text="<% $PayrollResources:Admin.CustomerAdd.SaveButton.Text %>"
                    ToolTip="<% $PayrollResources:Admin.CustomerAdd.SaveButton.Tooltip %>" CssClass="adminButtonBlue" OnClientClick="return show()" OnClick="SaveButton_Click" />
                <asp:Button ID="SaveAndStayButton" runat="server" CssClass="adminButtonBlue" Text="<% $PayrollResources:Admin.CustomerAdd.SaveAndStayButton.Text %>" ToolTip="<% $PayrollResources:Admin.CustomerAdd.SaveAndStayButton.Tooltip %>"
                    OnClick="SaveAndStayButton_Click" OnClientClick="return show()" />
            </div>
        </div>
        <table class="adminContent">
            <tr runat="server" id="pnlYesNo">
                <td class="adminTitle">
                    <uc1:ToolTipLabelControl runat="server" ID="lblpnlYesNoTitle" Text="<% $PayrollResources:Admin.CustomerAdd.Mesage %>"
                        ToolTip="<% $PayrollResources:Admin.CustomerAdd.Mesage.Tooltip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
                </td>
                <td class="adminData">
                    <asp:Label ID="lbMessage" runat="server" CssClass="adminInput" Text=""></asp:Label>
                </td>
                <td class="adminData">
                    <asp:Button ID="Continue" CssClass="adminButtonBlue" runat="server" Text="Tiếp tực lưu" ToolTip="Nếu bạn tiếp tục lưu, hệ thống sẽ sinh ra một thẻ khách hàng mới." OnClick="Continue_Click" />
                    <asp:Button ID="btnSaveAndStay" CssClass="adminButtonBlue" runat="server" Text="Tiếp tực lưu và ở lại" ToolTip="Nếu bạn tiếp tục lưu, hệ thống sẽ sinh ra một thẻ khách hàng mới." OnClick="btnSaveAndStay_Click" />
                    <asp:Button ID="Cancel" CssClass="adminButtonBlue" runat="server" Text="Đóng" ToolTip="Nếu đóng hệ thống dừng việc phat sinh thẻ khách hàng." OnClick="Cancel_Click" />
                </td>
            </tr>
        </table>
        <ajaxToolkit:ConfirmButtonExtender ID="cbeSearch" runat="server" TargetControlID="btnPrintCustInfo"
            DisplayModalPopupID="mpeSearch" />
        <ajaxToolkit:ModalPopupExtender runat="server" ID="mpeSearch" TargetControlID="btnPrintCustInfo"
            OkControlID="btnAssignOk" CancelControlID="btnAssignCancel" PopupControlID="pnlSearchPopupPanel"
            BackgroundCssClass="modalBackground" />
        <asp:Panel runat="server" ID="pnlSearchPopupPanel" Style="display: none; width: auto; height: auto; background-color: White; border-width: 2px; border-color: red; border-style: solid; padding: 10px;">
            <div style="text-align: center;">
                <div class="title">
                    <img src="Common/ico-customers.png" alt='<%=GetLocaleResourceString("Admin.CustomerAdd.PrintOption")%>' />
                    <%=GetLocaleResourceString("Admin.CustomerAdd.PrintOption")%>
                </div>
                <p></p>
                <div style="text-align: left;">
                    <asp:RadioButtonList ID="RdButtonListOption" runat="server" RepeatDirection="Vertical">
                        <asp:ListItem Value="0">Tất cả &nbsp;</asp:ListItem>
                        <asp:ListItem Value="1">Thông tin khách hàng &nbsp;</asp:ListItem>
                        <asp:ListItem Value="2">Case Profile &nbsp;</asp:ListItem>
                        <asp:ListItem Value="3">Thông tin cá nhân &nbsp;</asp:ListItem>
                        <asp:ListItem Value="4">Học tập &nbsp;</asp:ListItem>
                        <asp:ListItem Value="5">Tài chính &nbsp;</asp:ListItem>
                        <asp:ListItem Value="6">Tài sản &nbsp;</asp:ListItem>
                        <asp:ListItem Value="7">Hướng hỗ trợ &nbsp;</asp:ListItem>
                        <asp:ListItem Value="8">Nguồn tài chính cần làm &nbsp;</asp:ListItem>
                        <asp:ListItem Value="9">Kế hoạch chi phí &nbsp;</asp:ListItem>
                    </asp:RadioButtonList>
                </div>
                <p></p>
                <asp:Button ID="btnAssignOk" runat="server" Text="<% $PayrollResources:Admin.Common.OK %>"
                    CssClass="adminButtonBlue" CausesValidation="false" />
                <asp:Button ID="btnAssignCancel" runat="server" Text="<% $PayrollResources:Admin.Common.Cancel %>"
                    CssClass="adminButtonBlue" CausesValidation="false" />
            </div>
        </asp:Panel>
        <ajaxToolkit:TabContainer runat="server" ID="CustomerTabs" ActiveTabIndex="0">
            <ajaxToolkit:TabPanel runat="server" ID="pnlCustomerInfo" HeaderText="<% $PayrollResources:Admin.CustomerAdd.CustomerInfo %>">
                <ContentTemplate>
                    <uc3:CustomerInfo ID="ctrlCustomerInfo" runat="server" />
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="<% $PayrollResources:Admin.CustomerAdd.CaseProfile %>">
                <ContentTemplate>
                    <uc2:CaseProfileView ID="ctrlCaseProfileView" runat="server" />
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel runat="server" ID="pnlCustmerRelationship" HeaderText="<% $PayrollResources:Admin.CustomerAdd.Relationship %>">
                <ContentTemplate>
                    <uc4:Relationship ID="ctrlRelationship" runat="server" />
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
        </ajaxToolkit:TabContainer>        
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="SaveButton" />
        <asp:PostBackTrigger ControlID="SaveAndStayButton" />
    </Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="up1" runat="server" AssociatedUpdatePanelID="upForumSubscriptions">
    <ProgressTemplate>
        <div class="progress">
            <asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/images/UpdateProgress.gif"
                AlternateText="update" />
            <%=GetLocaleResourceString("Admin.Common.Wait...")%>
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>
